<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="filename" content="time-tracker-app-optimized.html">
    <title>时间记录App - 优化版</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        body {
            background: linear-gradient(135deg, #eef2f7, #d9e4f5);
            color: #2c3e50;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .header-container {
            text-align: center;
            margin-bottom: 30px;
            max-width: 900px;
            padding: 0 20px;
        }

        h1 {
            font-size: 2.8rem;
            margin-bottom: 10px;
            color: #2c3e50;
            background: linear-gradient(to right, #4A90E2, #9575CD);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            font-weight: 700;
        }

        .subtitle {
            font-size: 1.2rem;
            color: #5c6a7d;
            margin-bottom: 20px;
            line-height: 1.6;
        }

        .app-container {
            display: flex;
            flex-wrap: wrap;
            gap: 30px;
            justify-content: center;
            max-width: 1600px;
        }

        .app-device {
            width: 375px;
            height: 812px;
            background: white;
            border-radius: 36px;
            overflow: hidden;
            box-shadow: 0 25px 60px rgba(74, 144, 226, 0.25);
            position: relative;
            transition: transform 0.4s ease-out, box-shadow 0.4s;
        }

        .app-device:hover {
            transform: translateY(-8px);
            box-shadow: 0 30px 70px rgba(74, 144, 226, 0.35);
        }

        .app-header {
            background: linear-gradient(135deg, #4A90E2, #3A7CD5);
            padding: 60px 20px 20px;
            color: white;
            text-align: center;
            position: relative;
        }

        .notch {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            width: 180px;
            height: 32px;
            background: black;
            border-radius: 16px;
        }

        .status-bar {
            position: absolute;
            top: 25px;
            left: 25px;
            right: 25px;
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
        }

        .status-icons {
            display: flex;
            gap: 6px;
        }

        .app-name {
            font-size: 1.4rem;
            font-weight: 600;
            margin-bottom: 4px;
            letter-spacing: 0.5px;
        }

        .header-sub {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .stats-duration {
            font-weight: 700;
            font-size: 1.1rem;
            margin-left: 4px;
        }

        .app-content {
            padding: 20px;
            height: calc(100% - 130px);
            position: relative;
            background: #F8FAFE;
            overflow-y: auto;
            scrollbar-width: thin;
        }

        .app-content::-webkit-scrollbar {
            width: 6px;
        }

        .app-content::-webkit-scrollbar-thumb {
            background: rgba(74, 144, 226, 0.3);
            border-radius: 3px;
        }

        .section-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin: 20px 0 15px;
            color: #2c3e50;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .card {
            background: white;
            border-radius: 20px;
            padding: 18px;
            margin-bottom: 18px;
            box-shadow: 0 8px 25px rgba(74, 144, 226, 0.08);
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .card:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 30px rgba(74, 144, 226, 0.15);
        }

        .task-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .task-info {
            display: flex;
            align-items: center;
            flex: 1;
        }

        .task-icon {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            color: white;
            font-size: 20px;
        }

        .work-bg { background: #FF9F40; }
        .study-bg { background: #4CAF50; }
        .sport-bg { background: #9575CD; }
        .rest-bg { background: #42A5F5; }
        .read-bg { background: #FF7043; }
        .music-bg { background: #EC407A; }

        .task-text {
            display: flex;
            flex-direction: column;
        }

        .task-name {
            font-weight: 600;
            margin-bottom: 4px;
            font-size: 1.1rem;
        }

        .task-time {
            font-size: 0.85rem;
            color: #666;
            opacity: 0.9;
        }

        .btn {
            border: none;
            border-radius: 50%;
            width: 56px;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 5px 15px rgba(0,0,0,0.12);
        }

        .btn:active {
            transform: scale(0.92);
        }

        .start-btn {
            background: #62D2A2;
            color: white;
        }

        .stop-btn {
            background: #FF6B6B;
            color: white;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.5); }
            70% { box-shadow: 0 0 0 12px rgba(255, 107, 107, 0); }
            100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
        }

        /* 统计图表容器 - 优化部分 */
        .chart-container {
            height: 240px;
            margin: 15px 0 25px;
            position: relative;
            overflow: hidden;
            border-radius: 16px;
            background: white;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .chart-divider {
            margin: 20px 0;
            text-align: center;
            color: #7b8797;
            position: relative;
        }

        .chart-divider::before,
        .chart-divider::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 35%;
            height: 1px;
            background: linear-gradient(to right, transparent, #dde3ed, transparent);
        }

        .chart-divider::before {
            left: 0;
        }

        .chart-divider::after {
            right: 0;
        }

        /* 数据摘要 */
        .stats-summary {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
            margin-top: 20px;
        }

        .stat-item {
            background: white;
            padding: 16px 20px;
            border-radius: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
        }

        .stat-label {
            font-weight: 500;
            color: #666;
        }

        .stat-value {
            font-weight: 700;
            color: #4A90E2;
            font-size: 1.1rem;
        }

        /* 设置页面样式 */
        .avatar-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 15px 0 30px;
        }

        .avatar {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            background: linear-gradient(135deg, #4A90E2, #9575CD);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 34px;
            color: white;
            margin-bottom: 15px;
            box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
        }

        .user-name {
            text-align: center;
            font-weight: 700;
            font-size: 1.3rem;
            color: #2c3e50;
        }

        .setting-item {
            display: flex;
            align-items: center;
            padding: 18px 20px;
            background: white;
            border-radius: 16px;
            margin-bottom: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            transition: all 0.2s ease;
        }

        .setting-item:hover {
            transform: translateX(4px);
            background: #f8fbff;
        }

        .setting-icon {
            width: 42px;
            height: 42px;
            background: linear-gradient(135deg, rgba(98, 210, 162, 0.15), rgba(74, 144, 226, 0.15));
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            margin-right: 15px;
            color: #4A90E2;
            font-size: 18px;
        }

        .setting-text {
            font-weight: 500;
            color: #2c3e50;
            font-size: 1.05rem;
        }

        /* 添加按钮 */
        .add-btn {
            position: absolute;
            bottom: 110px;
            right: 30px;
            background: #4A90E2;
            color: white;
            width: 68px;
            height: 68px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            box-shadow: 0 6px 20px rgba(74, 144, 226, 0.45);
            z-index: 10;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .add-btn:hover {
            transform: scale(1.05) rotate(90deg);
        }

        /* 导航栏 */
        .nav-bar {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            display: flex;
            justify-content: space-around;
            height: 80px;
            border-top: 1px solid #f0f0f0;
            align-items: center;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 0.8rem;
            color: #7b8797;
            cursor: pointer;
            transition: all 0.2s;
            padding: 8px;
            border-radius: 12px;
        }

        .nav-item:hover {
            background: rgba(74, 144, 226, 0.05);
        }

        .nav-item i {
            font-size: 22px;
            margin-bottom: 6px;
        }

        .nav-item.active {
            color: #4A90E2;
            transform: translateY(-5px);
        }

        .nav-text {
            font-weight: 500;
            font-size: 0.85rem;
        }

        @media (max-width: 1200px) {
            .app-container {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media (max-width: 800px) {
            .app-container {
                grid-template-columns: 1fr;
            }
        }

        .page-description {
            position: absolute;
            right: 20px;
            top: 90px;
            background: rgba(255,255,255,0.9);
            padding: 10px 15px;
            border-radius: 12px;
            font-size: 0.85rem;
            box-shadow: 0 3px 10px rgba(0,0,0,0.08);
            max-width: 220px;
            z-index: 100;
            color: #4A90E2;
            font-weight: 500;
        }
    </style>
</head>
<body>
    <div class="header-container">
        <h1>时间记录App - 优化版</h1>
        <p class="subtitle">根据用户反馈优化了统计分析页面，解决了图表重叠问题，改进了整体布局与用户体验</p>
    </div>

    <div class="app-container">
        <!-- 首页 -->
        <div class="app-device">
            <div class="app-header">
                <div class="notch"></div>
                <div class="status-bar">
                    <span>9:41</span>
                    <div class="status-icons">
                        <i class="fas fa-signal"></i>
                        <i class="fas fa-wifi"></i>
                        <i class="fas fa-battery-three-quarters"></i>
                    </div>
                </div>
                <div class="app-name">时间记录</div>
                <div class="header-sub">今天总计: <span class="stats-duration">4小时22分钟</span></div>
            </div>

            <div class="app-content">
                <div class="section-title">
                    <i class="fas fa-hourglass-half"></i>
                    <span>正在进行的任务</span>
                </div>

                <div class="card task-card">
                    <div class="task-info">
                        <div class="task-icon work-bg">
                            <i class="fas fa-laptop"></i>
                        </div>
                        <div class="task-text">
                            <div class="task-name">工作</div>
                            <div class="task-time">已进行 2小时15分钟</div>
                        </div>
                    </div>
                    <div class="btn stop-btn">
                        <i class="fas fa-stop"></i>
                    </div>
                </div>

                <div class="section-title">
                    <i class="fas fa-tasks"></i>
                    <span>所有任务</span>
                </div>

                <div class="card task-card">
                    <div class="task-info">
                        <div class="task-icon study-bg">
                            <i class="fas fa-book"></i>
                        </div>
                        <div class="task-name">学习</div>
                    </div>
                    <div class="btn start-btn">
                        <i class="fas fa-play"></i>
                    </div>
                </div>

                <div class="card task-card">
                    <div class="task-info">
                        <div class="task-icon sport-bg">
                            <i class="fas fa-running"></i>
                        </div>
                        <div class="task-name">运动</div>
                    </div>
                    <div class="btn start-btn">
                        <i class="fas fa-play"></i>
                    </div>
                </div>

                <div class="card task-card">
                    <div class="task-info">
                        <div class="task-icon rest-bg">
                            <i class="fas fa-coffee"></i>
                        </div>
                        <div class="task-name">休息</div>
                    </div>
                    <div class="btn start-btn">
                        <i class="fas fa-play"></i>
                    </div>
                </div>

                <div class="card task-card">
                    <div class="task-info">
                        <div class="task-icon read-bg">
                            <i class="fas fa-book-reader"></i>
                        </div>
                        <div class="task-name">阅读</div>
                    </div>
                    <div class="btn start-btn">
                        <i class="fas fa-play"></i>
                    </div>
                </div>
            </div>

            <div class="nav-bar">
                <div class="nav-item active">
                    <i class="fas fa-play-circle"></i>
                    <div class="nav-text">任务</div>
                </div>
                <div class="nav-item">
                    <i class="fas fa-chart-pie"></i>
                    <div class="nav-text">统计</div>
                </div>
                <div class="nav-item">
                    <i class="fas fa-cog"></i>
                    <div class="nav-text">设置</div>
                </div>
            </div>
        </div>

        <!-- 统计分析页（优化版本） -->
        <div class="app-device">
            <div class="app-header">
                <div class="notch"></div>
                <div class="status-bar">
                    <span>9:41</span>
                    <div class="status-icons">
                        <i class="fas fa-signal"></i>
                        <i class="fas fa-wifi"></i>
                        <i class="fas fa-battery-three-quarters"></i>
                    </div>
                </div>
                <div class="app-name">统计分析</div>
                <div class="header-sub">上周数据分析</div>
            </div>

            <div class="app-content">
                <div class="section-title">
                    <i class="fas fa-chart-pie"></i>
                    <span>本周时间使用情况</span>
                </div>

                <div class="page-description">
                    <i class="fas fa-info-circle"></i>
                    优化后的图表布局更清晰
                </div>

                <!-- 饼图容器 -->
                <div class="chart-container" id="pieChart"></div>

                <div class="chart-divider">每日趋势分析</div>

                <!-- 柱状图容器 -->
                <div class="chart-container" id="barChart"></div>

                <div class="stats-summary">
                    <div class="stat-item">
                        <div class="stat-label">平均每日有效时长:</div>
                        <div class="stat-value">6小时22分钟</div>
                    </div>

                    <div class="stat-item">
                        <div class="stat-label">最常进行的任务:</div>
                        <div class="stat-value">学习 (占总时间32%)</div>
                    </div>

                    <div class="stat-item">
                        <div class="stat-label">连续记录天数:</div>
                        <div class="stat-value">27天</div>
                    </div>
                </div>
            </div>

            <div class="nav-bar">
                <div class="nav-item">
                    <i class="fas fa-play-circle"></i>
                    <div class="nav-text">任务</div>
                </div>
                <div class="nav-item active">
                    <i class="fas fa-chart-pie"></i>
                    <div class="nav-text">统计</div>
                </div>
                <div class="nav-item">
                    <i class="fas fa-cog"></i>
                    <div class="nav-text">设置</div>
                </div>
            </div>
        </div>

        <!-- 设置页面 -->
        <div class="app-device">
            <div class="app-header">
                <div class="notch"></div>
                <div class="status-bar">
                    <span>9:41</span>
                    <div class="status-icons">
                        <i class="fas fa-signal"></i>
                        <i class="fas fa-wifi"></i>
                        <i class="fas fa-battery-three-quarters"></i>
                    </div>
                </div>
                <div class="app-name">个人设置</div>
            </div>

            <div class="app-content">
                <div class="avatar-container">
                    <div class="avatar">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="user-name">李明</div>
                </div>

                <div class="section-title">
                    <i class="fas fa-cog"></i>
                    <span>设置选项</span>
                </div>

                <div class="setting-item">
                    <div class="setting-icon">
                        <i class="fas fa-bullseye"></i>
                    </div>
                    <div class="setting-text">我的目标</div>
                </div>

                <div class="setting-item">
                    <div class="setting-icon">
                        <i class="fas fa-robot"></i>
                    </div>
                    <div class="setting-text">AI分析报告</div>
                </div>

                <div class="setting-item">
                    <div class="setting-icon">
                        <i class="fas fa-bell"></i>
                    </div>
                    <div class="setting-text">提醒设置</div>
                </div>

                <div class="setting-item">
                    <div class="setting-icon">
                        <i class="fas fa-file-export"></i>
                    </div>
                    <div class="setting-text">导出数据</div>
                </div>

                <div class="add-btn">
                    <i class="fas fa-plus"></i>
                </div>
            </div>

            <div class="nav-bar">
                <div class="nav-item">
                    <i class="fas fa-play-circle"></i>
                    <div class="nav-text">任务</div>
                </div>
                <div class="nav-item">
                    <i class="fas fa-chart-pie"></i>
                    <div class="nav-text">统计</div>
                </div>
                <div class="nav-item active">
                    <i class="fas fa-cog"></i>
                    <div class="nav-text">设置</div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 初始化饼图
        const pieChart = echarts.init(document.getElementById('pieChart'));
        const pieOption = {
            tooltip: {
                trigger: 'item',
                formatter: '{b}: {c}小时 ({d}%)'
            },
            legend: {
                orient: 'horizontal',
                bottom: 0,
                itemGap: 10,
                textStyle: {
                    fontSize: 12,
                    fontWeight: 500,
                    color: '#5c6a7d'
                },
                data: ['工作', '学习', '运动', '休息', '阅读', '其他']
            },
            grid: {
                top: 20,
                bottom: 50,
                left: 20,
                right: 20
            },
            series: [
                {
                    name: '时间分布',
                    type: 'pie',
                    radius: ['40%', '70%'],
                    center: ['50%', '45%'],
                    avoidLabelOverlap: true,
                    itemStyle: {
                        borderRadius: 10,
                        borderColor: '#fff',
                        borderWidth: 2
                    },
                    label: {
                        show: true,
                        formatter: '{d}%',
                        fontSize: 12,
                        fontWeight: 600
                    },
                    emphasis: {
                        scale: true,
                        scaleSize: 8,
                        label: {
                            show: true,
                            fontSize: 14,
                            fontWeight: 'bold'
                        }
                    },
                    labelLine: {
                        smooth: true,
                        length: 10,
                        length2: 20
                    },
                    data: [
                        {value: 8.35, name: '工作', itemStyle: {color: '#FF9F40'}},
                        {value: 15.48, name: '学习', itemStyle: {color: '#4CAF50'}},
                        {value: 3.8, name: '运动', itemStyle: {color: '#9575CD'}},
                        {value: 7.35, name: '休息', itemStyle: {color: '#42A5F5'}},
                        {value: 5.80, name: '阅读', itemStyle: {color: '#FF7043'}},
                        {value: 2.20, name: '其他', itemStyle: {color: '#9E9E9E'}}
                    ]
                }
            ]
        };
        pieChart.setOption(pieOption);

        // 初始化柱状图
        const barChart = echarts.init(document.getElementById('barChart'));
        const barOption = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                },
                formatter: '{b}: {c}小时'
            },
            grid: {
                left: '10%',
                right: '10%',
                bottom: '15%',
                top: '15%',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
                axisLine: {
                    lineStyle: {
                        color: '#dde3ed'
                    }
                },
                axisLabel: {
                    color: '#5c6a7d',
                    fontWeight: 500
                },
                axisTick: {
                    alignWithLabel: true
                }
            },
            yAxis: {
                type: 'value',
                name: '小时',
                min: 0,
                max: 10,
                nameTextStyle: {
                    color: '#5c6a7d',
                    fontSize: 12,
                    padding: [0, 0, 0, -35]
                },
                axisLabel: {
                    color: '#5c6a7d',
                    fontWeight: 500
                },
                splitLine: {
                    lineStyle: {
                        color: '#f0f4fa',
                        type: 'dashed'
                    }
                }
            },
            series: [
                {
                    name: '总时长',
                    type: 'bar',
                    barWidth: '30px',
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            {offset: 0, color: '#4A90E2'},
                            {offset: 1, color: '#85bbf0'}
                        ]),
                        borderRadius: [8, 8, 0, 0],
                        shadowColor: 'rgba(74, 144, 226, 0.4)',
                        shadowBlur: 6
                    },
                    label: {
                        show: true,
                        position: 'top',
                        color: '#4A90E2',
                        fontWeight: 600
                    },
                    data: [3.5, 5.2, 6.0, 4.8, 7.1, 5.5, 4.5]
                }
            ]
        };
        barChart.setOption(barOption);

        // 响应式调整
        window.addEventListener('resize', function() {
            pieChart.resize();
            barChart.resize();
        });

        // 实现按钮交互效果
        const buttons = document.querySelectorAll('.btn, .nav-item, .setting-item, .add-btn');
        buttons.forEach(button => {
            button.addEventListener('mousedown', () => {
                button.style.transform = 'scale(0.92)';
            });

            button.addEventListener('mouseup', () => {
                button.style.transform = '';
            });

            button.addEventListener('mouseleave', () => {
                button.style.transform = '';
            });
        });

        // 模拟导航切换
        const navItems = document.querySelectorAll('.nav-item');
        navItems.forEach(item => {
            item.addEventListener('click', function() {
                navItems.forEach(el => el.classList.remove('active'));
                this.classList.add('active');

                // 显示视觉效果变化
                this.style.backgroundColor = 'rgba(74, 144, 226, 0.1)';
                setTimeout(() => {
                    this.style.backgroundColor = '';
                }, 300);
            });
        });
    </script>
</body>
</html>